package com.xizimall.rest.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
/**
 * 内容管理
 * <p>Title: ContentController</p>
 * <p>Description: </p>
 * <p>华南理工大学研究生</p> 
 * @author	李隆熹
 * @date	2018年4月18日下午10:01:21
 * @version 1.0
 */
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.xizimall.pojo.TbContent;
import com.xizimall.rest.service.ContentService;
import com.xizimall.common.pojo.XizimallResult;
import com.xizimall.common.utils.ExceptionUtil;
@Controller
@RequestMapping("/content")
public class ContentController {
      
	@Autowired
	private ContentService contentService;
	
	@RequestMapping("/list/{contentCategoryId}")
	@ResponseBody
	public XizimallResult getContentList(@PathVariable Long contentCategoryId){
	try {
		List<TbContent> list=contentService.getContentlist(contentCategoryId);
	    return XizimallResult.ok(list);
	} catch (Exception e) {
		e.printStackTrace();
		return XizimallResult.build(500, ExceptionUtil.getStackTrace(e));
	}
	
	}

}
